package mode

import (
	"gorm.io/gorm"
)

type Db_apm struct {
	gorm.Model
	Room       int       `json:"room_id" form:"room_id" gorm:"type:int;index;comment:'房间号 用户编号，外键，关联到用户表';unique;" binding:"required" required_msg:" room_id 为必填项目" `
	WaterPrice float64   `json:"water_price" form:"power_price"  binding:"omitempty" required_msg:"power_price 为必填项目,参数为数字" gorm:"type:decimal(10,2);default:4.9;comment:'水费单价，decimal类型，用于记录水费单价。'"`
	PowerPrice float64   `json:"power_price" form:"water_price"  binding:"omitempty" required_msg:"water_price 为必填项目,参数为数字" gorm:"type:decimal(10,2);default:0.9;comment:'电费单价，decimal类型，用于记录电费单价。'"`
	Des        string    `json:"desc" form:"desc" binding:"omitempty" validate:"max=200" required_msg:"desc 长度不可超200字符" gorm:"type:varchar(200);"`
	Cost       []Db_cost `gorm:"foreignKey:RoomId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}
